
import {
  defineConfig,
  presetAttributify,
  presetMini,
  transformerDirectives,
} from 'unocss'

export default defineConfig({
  rules: [
    ['m-auto', { 'margin': '0 auto' }],
    ['list-none', { 'list-style-type': 'none' }],
    // 单边框
    [
      /^b([trbl])-(\d+)-\[(.+)\]$/,
      ([, dir, size, color]) => ({
        [`border-${{ t: 'top', r: 'right', b: 'bottom', l: 'left' }[dir]}`]: `${size}px solid ${color}`
      })
    ],
    // 全边框
    [
      /^b-(\d+)-\[([^\s\]]+)\]$/,
      ([, size, color]) => ({ border: `${size}px solid ${color}` })
    ],
  ],
  shortcuts: [
  ],
  presets: [
    presetMini(),
    presetAttributify(),
  ],
  transformers: [
    transformerDirectives(),
    // transformerVariantGroup(),
  ],
})